import { createApp } from "vue";
import App from "./App.vue";
import "./index.css";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import router from "./router";
import "animate.css";
import pinia from "@/store";
import { useUserStore } from "./store/user";

createApp(App).use(router).use(pinia).use(ElementPlus).mount("#app");

const userStorage = sessionStorage.getItem("user");

if (useUserStore().type === -1 && userStorage) {
  useUserStore().setUser(JSON.parse(userStorage));
}
